#!/bin/sh

rm -f product.key

while true
do
	export FWPK_NAME=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40`
	echo
	echo

	../src/fwpk -name "$FWPK_NAME" > product.key
	if ( test "$?" = "1" )
	then
		rm -f product.key
		exit 1
	fi

	make > /dev/null 2>&1
	if ( test "$?" = "1" )
	then
		rm -f product.key
		exit 1
	fi

	./product
	if ( test "$?" = "1" )
	then
		rm -f product.key
		exit 1
	fi
done
